package com.panfeng.xcloud.boss.provider.member.web.controller;

import com.alibaba.fastjson.JSONObject;
import com.panfeng.xcloud.boss.provider.member.dao.mapper.UserBaseMapperExt;
import com.panfeng.xcloud.boss.provider.member.dto.request.*;
import com.panfeng.xcloud.boss.provider.member.dto.response.*;
import com.panfeng.xcloud.boss.provider.member.security.auth.UserDetailsServiceImpl;
import com.panfeng.xcloud.boss.provider.member.service.IUserBasicService;
import com.panfeng.xcloud.boss.provider.member.web.vo.request.*;
import com.panfeng.xcloud.boss.provider.member.web.vo.response.*;
import com.panfeng.xcloud.common.core.utils.ConvertUtils;
import com.panfeng.xcloud.common.core.utils.TokenUtils;
import com.panfeng.xcloud.common.core.web.vo.ResponseVO;
import com.panfeng.xcloud.common.security.annotation.MethodValidate;
import com.panfeng.xcloud.common.security.annotation.NotNeedAccess;
import com.panfeng.xcloud.common.security.vo.SysSecurityUser;
import com.panfeng.xcloud.common.security.web.support.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
 * 用户信息模块
 *
 * @author xiaobo
 * @version 1.0
 * @since 2019-08-08
 */
@RestController
@RequestMapping("user/info")
@Api(tags = {"用户信息"})
@Slf4j
public class UserBasicInfoController extends BaseController {

    @Autowired
    private UserDetailsServiceImpl userDetailsServiceImpl;

    @Autowired
    private IUserBasicService iUserBasicService;

    @Resource
    private UserBaseMapperExt userBaseMapperExt;

    /**
     * 查询账号是否存在
     *
     * @param accountNumberStatusReqVO
     * @param bindingResult
     * @return
     */
    @ApiIgnore
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/queryAccountNumberStatus", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "查询账号是否存在(肖博)", httpMethod = "POST", notes = "查询账号是否存在(肖博)")
    public ResponseVO<AccountNumberStatusRespVO> queryAccountNumberStatus(@RequestBody @Valid AccountNumberStatusReqVO accountNumberStatusReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前queryAccountNumberStatus请求参数：{} <<<", (null != accountNumberStatusReqVO ? JSONObject.toJSONString(accountNumberStatusReqVO) : ""));
        AccountNumberStatusReqDTO accountNumberStatusReqDTO = ConvertUtils.convert(accountNumberStatusReqVO, AccountNumberStatusReqDTO.class);
        AccountNumberStatusRespDTO accountNumberStatusRespDTO = iUserBasicService.queryAccountNumberStatus(accountNumberStatusReqDTO);
        AccountNumberStatusRespVO accountNumberStatusRespVO = ConvertUtils.convert(accountNumberStatusRespDTO, AccountNumberStatusRespVO.class);
        logger.info(">>>> 当前queryAccountNumberStatus响应内容：{} <<<", (null != accountNumberStatusRespVO ? JSONObject.toJSONString(accountNumberStatusRespVO) : ""));
        return ResponseVO.with(accountNumberStatusRespVO);
    }

    /**
     * 根据token换userId
     *
     * @param request
     * @return
     */
    @PostMapping(value = "/getUserIdForToken", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "根据token换userId(肖博)", httpMethod = "POST", notes = "根据token换userId(肖博)")
    @NotNeedAccess
    public ResponseVO getUserIdForToken(HttpServletRequest request) {
        String token = TokenUtils.getToken(request);
        logger.info(">>>> 当前getUserIdForToken请求header参数：{} <<<", token);
        SysSecurityUser currentUserByToken = this.getCurrentUserByToken(token);
        String userId = currentUserByToken.getUserId();
        logger.info(">>>> 当前getUserIdForToken响应内容：{} <<<", userId);
        return ResponseVO.with(userId);
    }

    /**
     * 验证app版本
     *
     * @param checkAppVersionReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/checkAppVersion", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "验证app版本(肖博)", httpMethod = "POST", notes = "验证app版本(肖博)")
    public ResponseVO<CheckAppVersionRespVO> checkAppVersion(@RequestBody @Valid CheckAppVersionReqVO checkAppVersionReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前checkAppVersion请求参数：{} <<<", (null != checkAppVersionReqVO ? JSONObject.toJSONString(checkAppVersionReqVO) : ""));
        CheckAppVersionReqDTO checkAppVersionReqDTO = ConvertUtils.convert(checkAppVersionReqVO, CheckAppVersionReqDTO.class);
        CheckAppVersionRespDTO checkAppVersionRespDTO = iUserBasicService.checkAppVersion(checkAppVersionReqDTO);
        CheckAppVersionRespVO checkAppVersionRespVO = ConvertUtils.convert(checkAppVersionRespDTO, CheckAppVersionRespVO.class);
        logger.info(">>>> 当前checkAppVersion响应内容：{} <<<", (null != checkAppVersionRespVO ? JSONObject.toJSONString(checkAppVersionRespVO) : ""));
        return ResponseVO.with(checkAppVersionRespVO);
    }

    /**
     * 查询当前ocr身份认证当前限制次数
     *
     * @param queryOcrAuthCountReqVO
     * @param bindingResult
     * @return
     */
    @ApiIgnore
    @MethodValidate
    @PostMapping(value = "/queryCurrentOcrAuthCount", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "查询当前ocr身份认证当前限制次数(肖博)", httpMethod = "POST", notes = "查询当前ocr身份认证当前限制次数(肖博)")
    public ResponseVO<QueryOcrAuthCountRespVO> queryCurrentOcrAuthCount(@RequestBody @Valid QueryOcrAuthCountReqVO queryOcrAuthCountReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前queryCurrentOcrAuthCount请求参数：{} <<<", (null != queryOcrAuthCountReqVO ? JSONObject.toJSONString(queryOcrAuthCountReqVO) : ""));
        QueryOcrAuthCountReqDTO queryOcrAuthCountReqDTO = ConvertUtils.convert(queryOcrAuthCountReqVO, QueryOcrAuthCountReqDTO.class);
        QueryOcrAuthCountRespDTO queryOcrAuthCountRespDTO = iUserBasicService.queryCurrentOcrAuthCount(queryOcrAuthCountReqDTO);
        QueryOcrAuthCountRespVO queryOcrAuthCountRespVO = ConvertUtils.convert(queryOcrAuthCountRespDTO, QueryOcrAuthCountRespVO.class);
        logger.info(">>>> 当前queryCurrentOcrAuthCount响应内容：{} <<<", (null != queryOcrAuthCountRespVO ? JSONObject.toJSONString(queryOcrAuthCountRespVO) : ""));
        return ResponseVO.with(queryOcrAuthCountRespVO);
    }

    /**
     * ocr身份认证
     *
     * @param userEntityOcrReqVO
     * @param bindingResult
     * @return
     */
    @ApiIgnore
    @MethodValidate
    @PostMapping(value = "/ocrIdentityAuthentication", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "ocr身份认证(肖博)", httpMethod = "POST", notes = "ocr身份认证(肖博)")
    public ResponseVO ocrIdentityAuthentication(@RequestBody @Valid UserEntityOcrReqVO userEntityOcrReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前ocrIdentityAuthentication请求参数：{} <<<", (null != userEntityOcrReqVO ? JSONObject.toJSONString(userEntityOcrReqVO) : ""));
        UserEntityOcrReqDTO userEntityOcrReqDTO = ConvertUtils.convert(userEntityOcrReqVO, UserEntityOcrReqDTO.class);
        iUserBasicService.ocrIdentityAuthentication(userEntityOcrReqDTO);
        return ResponseVO.success();
    }

    /**
     * 重置登录密码
     *
     * @param resetLoginPwdReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/resetLoginPwd", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "重置登录密码(肖博)", httpMethod = "POST", notes = "重置登录密码(肖博)")
    public ResponseVO resetLoginPwd(@RequestBody @Valid ResetLoginPwdReqVO resetLoginPwdReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前resetLoginPwd请求参数：{} <<<", (null != resetLoginPwdReqVO ? JSONObject.toJSONString(resetLoginPwdReqVO) : ""));
        ResetLoginPwdReqDTO resetLoginPwdReqDTO = ConvertUtils.convert(resetLoginPwdReqVO, ResetLoginPwdReqDTO.class);
        boolean rs = iUserBasicService.resetLoginPwd(resetLoginPwdReqDTO);
        return rs ? ResponseVO.success() : ResponseVO.error();
    }

    /**
     * 身份认证状态
     *
     * @param identityOcrAuthStatusReqVO
     * @param bindingResult
     * @return
     */
    @ApiIgnore
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/getAuditStatus", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "身份认证状态(肖博)", httpMethod = "POST", notes = "身份认证状态(肖博)")
    public ResponseVO<IdentityOcrAuthStatusRespVO> getAuditStatus(@RequestBody @Valid IdentityOcrAuthStatusReqVO identityOcrAuthStatusReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前getAuditStatus请求参数：{} <<<", (null != identityOcrAuthStatusReqVO ? JSONObject.toJSONString(identityOcrAuthStatusReqVO) : ""));
        IdentityOcrAuthStatusReqDTO identityOcrAuthStatusReqDTO = ConvertUtils.convert(identityOcrAuthStatusReqVO, IdentityOcrAuthStatusReqDTO.class);
        IdentityOcrAuthStatusRespDTO identityOcrAuthStatusRespDTO = iUserBasicService.getAuditStatus(identityOcrAuthStatusReqDTO);
        IdentityOcrAuthStatusRespVO identityOcrAuthStatusRespVO = ConvertUtils.convert(identityOcrAuthStatusRespDTO, IdentityOcrAuthStatusRespVO.class);
        logger.info(">>>> 当前getAuditStatus响应内容：{} <<<", (null != identityOcrAuthStatusRespVO ? JSONObject.toJSONString(identityOcrAuthStatusRespVO) : ""));
        return ResponseVO.with(identityOcrAuthStatusRespVO);
    }

    /**
     * 通过身份证号查询身份认证状态
     *
     * @param identityAuthStatusExtReqVO
     * @param bindingResult
     * @return
     */
    @ApiIgnore
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/getOcrAuditStatusByIdnumber", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "通过身份证号查询身份认证状态(肖博)", httpMethod = "POST", notes = "通过身份证号查询身份认证状态(肖博)")
    public ResponseVO<IdentityOcrAuthStatusRespVO> getOcrAuditStatusByIdnumber(@RequestBody @Valid IdentityAuthStatusExtReqVO identityAuthStatusExtReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前getOcrAuditStatusByIdnumber请求参数：{} <<<", (null != identityAuthStatusExtReqVO ? JSONObject.toJSONString(identityAuthStatusExtReqVO) : ""));
        IdentityAuthStatusExtReqDTO identityAuthStatusExtReqDTO = ConvertUtils.convert(identityAuthStatusExtReqVO, IdentityAuthStatusExtReqDTO.class);
        IdentityOcrAuthStatusRespDTO identityOcrAuthStatusRespDTO = iUserBasicService.getOcrAuditStatusByIdnumber(identityAuthStatusExtReqDTO);
        IdentityOcrAuthStatusRespVO identityOcrAuthStatusRespVO = ConvertUtils.convert(identityOcrAuthStatusRespDTO, IdentityOcrAuthStatusRespVO.class);
        logger.info(">>>> 当前getOcrAuditStatusByIdnumber响应内容：{} <<<", (null != identityOcrAuthStatusRespVO ? JSONObject.toJSONString(identityOcrAuthStatusRespVO) : ""));
        return ResponseVO.with(identityOcrAuthStatusRespVO);
    }

    /**
     * 基本资料-修改头像
     *
     * @param updHeadImgReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/updateHeadImg", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "基本资料-修改头像(肖博)", httpMethod = "POST", notes = "基本资料-修改头像(肖博)")
    public ResponseVO updateHeadImg(@RequestBody @Valid UpdHeadImgReqVO updHeadImgReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前updateHeadImg请求参数：{} <<<", (null != updHeadImgReqVO ? JSONObject.toJSONString(updHeadImgReqVO) : ""));
        UpdHeadImgReqDTO updHeadImgReqDTO = ConvertUtils.convert(updHeadImgReqVO, UpdHeadImgReqDTO.class);
        boolean rs = iUserBasicService.updateHeadImg(updHeadImgReqDTO);
        return rs ? ResponseVO.success() : ResponseVO.error();
    }

    /**
     * 账号安全-页面功能状态
     *
     * @param flagReqVO
     * @param bindingResult
     * @return
     */
    @ApiIgnore
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/flagDistinguish", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "账号安全-页面功能状态(肖博)", httpMethod = "POST", notes = "账号安全-页面功能状态(肖博)")
    public ResponseVO<FlagRespVO> flagDistinguish(@RequestBody @Valid FlagReqVO flagReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前flagDistinguish请求参数：{} <<<", (null != flagReqVO ? JSONObject.toJSONString(flagReqVO) : ""));
        FlagReqDTO flagReqDTO = ConvertUtils.convert(flagReqVO, FlagReqDTO.class);
        FlagRespDTO flagRespDTO = iUserBasicService.flagDistinguish(flagReqDTO);
        FlagRespVO flagRespVO = ConvertUtils.convert(flagRespDTO, FlagRespVO.class);
        logger.info(">>>> 当前flagDistinguish响应内容：{} <<<", (null != flagRespVO ? JSONObject.toJSONString(flagRespVO) : ""));
        return ResponseVO.with(flagRespVO);
    }

    /**
     * 账号安全-查询谷歌验证器秘钥
     *
     * @param queryGoogleVerifierKeyReqVO
     * @param bindingResult
     * @return
     */
    @ApiIgnore
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/queryGoogleVerifierKey", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "账号安全-查询谷歌验证器秘钥(肖博)", httpMethod = "POST", notes = "账号安全-查询谷歌验证器秘钥(肖博)")
    public ResponseVO<QueryGoogleVerifierKeyRespVO> queryGoogleVerifierKey(@RequestBody @Valid QueryGoogleVerifierKeyReqVO queryGoogleVerifierKeyReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前queryGoogleVerifierKey请求参数：{} <<<", (null != queryGoogleVerifierKeyReqVO ? JSONObject.toJSONString(queryGoogleVerifierKeyReqVO) : ""));
        QueryGoogleVerifierKeyReqDTO queryGoogleVerifierKeyReqDTO = ConvertUtils.convert(queryGoogleVerifierKeyReqVO, QueryGoogleVerifierKeyReqDTO.class);
        QueryGoogleVerifierKeyRespDTO queryGoogleVerifierKeyRespDTO = iUserBasicService.queryGoogleVerifierKey(queryGoogleVerifierKeyReqDTO);
        QueryGoogleVerifierKeyRespVO queryGoogleVerifierKeyRespVO = ConvertUtils.convert(queryGoogleVerifierKeyRespDTO, QueryGoogleVerifierKeyRespVO.class);
        logger.info(">>>> 当前queryGoogleVerifierKey响应内容：{} <<<", (null != queryGoogleVerifierKeyRespVO ? JSONObject.toJSONString(queryGoogleVerifierKeyRespVO) : ""));
        return ResponseVO.with(queryGoogleVerifierKeyRespVO);
    }

    /**
     * 账号安全-设置谷歌验证器秘钥
     *
     * @param googleVerifierKeyReqVO
     * @param bindingResult
     * @return
     */
    @ApiIgnore
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/setGoogleVerifierKey", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "账号安全-设置谷歌验证器秘钥(肖博)", httpMethod = "POST", notes = "账号安全-设置谷歌验证器秘钥(肖博)")
    public ResponseVO setGoogleVerifierKey(@RequestBody @Valid GoogleVerifierKeyReqVO googleVerifierKeyReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前setGoogleVerifierKey请求参数：{} <<<", (null != googleVerifierKeyReqVO ? JSONObject.toJSONString(googleVerifierKeyReqVO) : ""));
        GoogleVerifierKeyReqDTO googleVerifierKeyReqDTO = ConvertUtils.convert(googleVerifierKeyReqVO, GoogleVerifierKeyReqDTO.class);
        boolean rs = iUserBasicService.setGoogleVerifierKey(googleVerifierKeyReqDTO);
        return rs ? ResponseVO.success() : ResponseVO.error();
    }

    /**
     * 账号安全-修改手机号码/电子邮箱
     *
     * @param updMobileEmailReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/updateMobileEmail", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "账号安全-修改手机号码/电子邮箱(肖博)", httpMethod = "POST", notes = "账号安全-修改手机号码/电子邮箱(肖博)")
    public ResponseVO updateMobileEmail(@RequestBody @Valid UpdMobileEmailReqVO updMobileEmailReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前updateMobileEmail请求参数：{} <<<", (null != updMobileEmailReqVO ? JSONObject.toJSONString(updMobileEmailReqVO) : ""));
        UpdMobileEmailReqDTO updMobileEmailReqDTO = ConvertUtils.convert(updMobileEmailReqVO, UpdMobileEmailReqDTO.class);
        boolean rs = iUserBasicService.updateMobileEmail(updMobileEmailReqDTO);
        return rs ? ResponseVO.success() : ResponseVO.error();
    }

    /**
     * 账号安全-设置交易密码
     *
     * @param setTransPwdReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/setTransPwd", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "账号安全-设置交易密码(肖博)", httpMethod = "POST", notes = "账号安全-设置交易密码(肖博)")
    public ResponseVO setTransPwd(@RequestBody @Valid SetTransPwdReqVO setTransPwdReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前setTransPwd请求参数：{} <<<", (null != setTransPwdReqVO ? JSONObject.toJSONString(setTransPwdReqVO) : ""));
        SetTransPwdReqDTO setTransPwdReqDTO = ConvertUtils.convert(setTransPwdReqVO, SetTransPwdReqDTO.class);
        boolean rs = iUserBasicService.setTransPwd(setTransPwdReqDTO);
        return rs ? ResponseVO.success() : ResponseVO.error();
    }

    /**
     * 账号安全-修改登录/交易密码
     *
     * @param updPwdReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/updatePwd", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "账号安全-修改登录/交易密码(肖博)", httpMethod = "POST", notes = "账号安全-修改登录/交易密码(肖博)")
    public ResponseVO updatePwd(@RequestBody @Valid UpdPwdReqVO updPwdReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前updatePwd请求参数：{} <<<", (null != updPwdReqVO ? JSONObject.toJSONString(updPwdReqVO) : ""));
        UpdPwdReqDTO updPwdReqDTO = ConvertUtils.convert(updPwdReqVO, UpdPwdReqDTO.class);
        boolean rs = iUserBasicService.updatePwd(updPwdReqDTO);
        return rs ? ResponseVO.success() : ResponseVO.error();
    }

    /**
     * 基本资料-修改用户基本信息
     *
     * @param updInfoReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/updateBasicInfo", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "基本资料-修改用户基本信息(肖博)", httpMethod = "POST", notes = "基本资料-修改用户基本信息(肖博)")
    public ResponseVO updateBasicInfo(@RequestBody @Valid UpdInfoReqVO updInfoReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前updateBasicInfo请求参数：{} <<<", (null != updInfoReqVO ? JSONObject.toJSONString(updInfoReqVO) : ""));
        UpdInfoReqDTO updInfoReqDTO = ConvertUtils.convert(updInfoReqVO, UpdInfoReqDTO.class);
        boolean rs = iUserBasicService.updateBasicInfo(updInfoReqDTO);
        return rs ? ResponseVO.success() : ResponseVO.error();
    }

    /**
     * 基本资料-查询用户基本信息
     *
     * @param queryUserInfoReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/queryUserInfo", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "基本资料-查询用户基本信息(肖博)", httpMethod = "POST", notes = "基本资料-查询用户基本信息(肖博)")
    public ResponseVO<QueryUserInfoRespVO> queryUserInfo(@RequestBody @Valid QueryUserInfoReqVO queryUserInfoReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前queryUserInfo请求参数：{} <<<", (null != queryUserInfoReqVO ? JSONObject.toJSONString(queryUserInfoReqVO) : ""));
        QueryUserInfoReqDTO queryUserInfoReqDTO = ConvertUtils.convert(queryUserInfoReqVO, QueryUserInfoReqDTO.class);
        QueryUserInfoRespDTO queryUserInfoRespDTO = iUserBasicService.queryUserInfo(queryUserInfoReqDTO);
        QueryUserInfoRespVO queryUserInfoRespVO = ConvertUtils.convert(queryUserInfoRespDTO, QueryUserInfoRespVO.class);
        logger.info(">>>> 当前queryUserInfo响应内容：{} <<<", (null != queryUserInfoRespVO ? JSONObject.toJSONString(queryUserInfoRespVO) : ""));
        return ResponseVO.with(queryUserInfoRespVO);
    }

    /**
     * 用户注册
     *
     * @param regReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/register", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "用户注册(肖博)", httpMethod = "POST", notes = "用户注册(肖博)")
    public ResponseVO<RegRespVO> register(@RequestBody @Valid RegReqVO regReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前register请求参数：{} <<<", (null != regReqVO ? JSONObject.toJSONString(regReqVO) : ""));
        RegReqDTO regReqDTO = ConvertUtils.convert(regReqVO, RegReqDTO.class);
        RegRespDTO regRespDTO = iUserBasicService.register(regReqDTO);
        RegRespVO regRespVO = ConvertUtils.convert(regRespDTO, RegRespVO.class);
        logger.info(">>>> 当前register响应内容：{} <<<", (null != regRespVO ? JSONObject.toJSONString(regRespVO) : ""));
        return ResponseVO.with(regRespVO);
    }

    /**
     * 获取字典表配置
     *
     * @param getDefaultConfigReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/getDefaultConfig", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取字典表配置(肖博)", httpMethod = "POST", notes = "获取字典表配置(肖博)")
    public ResponseVO<GetDefaultConfigRespVO> getDefaultConfig(@RequestBody @Valid GetDefaultConfigReqVO getDefaultConfigReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前getDefaultConfig请求参数：{} <<<", (null != getDefaultConfigReqVO ? JSONObject.toJSONString(getDefaultConfigReqVO) : ""));
        GetDefaultConfigReqDTO getDefaultConfigReqDTO = ConvertUtils.convert(getDefaultConfigReqVO, GetDefaultConfigReqDTO.class);
        GetDefaultConfigRespDTO getDefaultConfigRespDTO = iUserBasicService.getDefaultConfig(getDefaultConfigReqDTO);
        GetDefaultConfigRespVO getDefaultConfigRespVO = ConvertUtils.convert(getDefaultConfigRespDTO, GetDefaultConfigRespVO.class);
        logger.info(">>>> 当前getDefaultConfig响应内容：{} <<<", (null != getDefaultConfigRespVO ? JSONObject.toJSONString(getDefaultConfigRespVO) : ""));
        return ResponseVO.with(getDefaultConfigRespVO);
    }

    /**
     * 修改字典表配置
     *
     * @param changeDefaultConfigReqVO
     * @param bindingResult
     * @return
     */
    @MethodValidate
    @NotNeedAccess
    @PostMapping(value = "/changeDefaultConfig", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改字典表配置(肖博)", httpMethod = "POST", notes = "修改字典表配置(肖博)")
    public ResponseVO<ChangeDefaultConfigRespVO> changeDefaultConfig(@RequestBody @Valid ChangeDefaultConfigReqVO changeDefaultConfigReqVO, BindingResult bindingResult) {
        logger.info(">>>> 当前changeDefaultConfig请求参数：{} <<<", (null != changeDefaultConfigReqVO ? JSONObject.toJSONString(changeDefaultConfigReqVO) : ""));
        ChangeDefaultConfigReqDTO changeDefaultConfigReqDTO = ConvertUtils.convert(changeDefaultConfigReqVO, ChangeDefaultConfigReqDTO.class);
        ChangeDefaultConfigRespDTO changeDefaultConfigRespDTO = iUserBasicService.changeDefaultConfig(changeDefaultConfigReqDTO);
        ChangeDefaultConfigRespVO changeDefaultConfigRespVO = ConvertUtils.convert(changeDefaultConfigRespDTO, ChangeDefaultConfigRespVO.class);
        logger.info(">>>> 当前changeDefaultConfig响应内容：{} <<<", (null != changeDefaultConfigRespVO ? JSONObject.toJSONString(changeDefaultConfigRespVO) : ""));
        return ResponseVO.with(changeDefaultConfigRespVO);
    }

}
